package com.tianquan.redisCache;/**
 * @author starsea
 * @date 2024-10-09 下午4:14
 */

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @BelongsProject: uploaddemo
 * @BelongsPackage: com.tianquan.redisCache
 * @Author: tianquan
 * @CreateTime: 2024-10-09  16:14
 * @Description: 测试
 * @Version: 1.0
 */

@RestController
public class test {

    @Cache(prefix = "cache", key = "#id2")
    @GetMapping("/cache1")
    public String cacke1(Long id1, Long id2) {
        System.out.println("查询缓存");
        return "hhhhhhh";
    }

    @Cache(prefix = "cache", key = "#user.id")
    @PostMapping("/cache2")
    public User cacke2(@RequestBody User user) {
        System.out.println("查询缓存");
        User tianquan = new User(22L, "tianquan", 21);
        return tianquan;
    }


}
